﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>功能测试页面</title>
    <link href="/api/Scripts/Editor/LayUI/css/layui.css" rel="stylesheet" />
    <script src="/api/Scripts/Vue/axios.min.js"></script>
    <script src="/api/Scripts/Vue/vue.min.js"></script>

    <style>
        #error {
            font-family: "Verdana";
            font-weight: normal;
            font-size: .7em;
            color: black;
            margin: 8px;
            padding: 5px;
        }

        p {
            font-family: "Verdana";
            font-weight: normal;
            color: black;
            margin-top: -5px
        }

        b {
            font-family: "Verdana";
            font-weight: bold;
            color: black;
            margin-top: -5px
        }

        H1 {
            font-family: "Verdana";
            font-weight: normal;
            font-size: 18pt;
            color: red
        }

        H2 {
            font-family: "Verdana";
            font-weight: normal;
            font-size: 14pt;
            color: maroon
        }

        pre {
            font-family: "Consolas","Lucida Console",Monospace;
            font-size: 11pt;
            margin: 0;
            padding: 0.5em;
            line-height: 14pt
        }

        .marker {
            font-weight: bold;
            color: black;
            text-decoration: none;
        }

        .version {
            color: gray;
        }

        .error {
            margin-bottom: 10px;
        }

        .expandable {
            text-decoration: underline;
            font-weight: bold;
            color: navy;
            cursor: pointer;
        }

        @media screen and (max-width: 639px) {
            pre {
                width: 440px;
                overflow: auto;
                white-space: pre-wrap;
                word-wrap: break-word;
            }
        }

        @media screen and (max-width: 479px) {
            pre {
                width: 280px;
            }
        }
    </style>
    <script type="text/javascript">
        var Vueapp;

        //url地址获取
        function GetGuDing(Ext) {
            var Curpath = window.document.location.href;
            var rootpath = Curpath.split("//")[0] + "//" + Curpath.split("//")[1].split("/")[0];
            console.log(rootpath);
            var InterFaceUrl = rootpath + Ext;
            console.log(InterFaceUrl);
            return InterFaceUrl;
        }

        //转换结果
        function ConvertData() {
            let cData={"data":Vueapp.data,"interfacecode":Vueapp.interfacecode};
            console.log(JSON.stringify(cData));
            axios({
                method: 'post',
                data: cData,
                url: GetGuDing('/api/InterfaceTool/execInterfaceByParm'),
                responseType: 'json'
            }).then(function (response) {

                var res = response.data.data;
                alert('调用完成');
            }).catch(function (error) {
                console.log('转换失败' + error);
            });
        }

        //界面完毕
        window.onload = function () {

            //根节点
            Vueapp = new Vue({
                el: "#app",
                data: {
                    data:'',
                    interfacecode:''
                },
                methods: {
                    onExec: function (obj) {
                        console.log('点击了执行');
                        ConvertData();
                    }
                },mounted:function() {
                    this.data='{"CLASS_CODE":"test","DICT_CODE":"111","DICT_NAME":"111","INPUT_CODE":"1","ORDER_NO":0,"CODING_SCHM":"1","MEMO":"string","HOSPITAL_NO":"1","CV_VALUE":"1","FN_VALUE":"1"}';
                    this.interfacecode='click';
                }

            })
        };
    </script>
</head>
<body>
    <div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div id="app" class="layui-row grid-demo">
                    <div class="layui-row " style="margin:5px;">
                        <div class="layui-col-md4">
                            <label class="layui-label">传入工具的参数</label>
                        </div>
                        <div class="layui-col-md8">
                            <input type="text" readonly="readonly" lay-verify="title" v-model="data" autocomplete="off" placeholder="请输入" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-row " style="margin:5px;">
                        <div class="layui-col-md4">
                            <label class="layui-label">传入调用接口工具方法固定</label>
                        </div>
                        <div class="layui-col-md8">
                            <input type="text" readonly="readonly" lay-verify="title" v-model="interfacecode" autocomplete="off" placeholder="请输入" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-row ">
                        <div class="layui-input-block">
                            <button @click="onExec" class="layui-btn layui-btn-sm">对接第三方接口</button>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>

</body>
</html>